package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class UE implements Serializable {

	private static final long serialVersionUID = 2557017924581039771L;

	private int numUE;
	private Semestre semestre;
	private Formation formation;
	private Collection<EC> listeEC;

	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public UE() {}
	
	public UE(int numUE, Semestre semestre, Formation formation) {
		super();
		this.numUE = numUE;
		this.semestre = semestre;
		this.formation = formation;
		this.listeEC = null;
	}

	public Collection<EC> getListeEC() {
		return listeEC;
	}

	public void setListeEC(Collection<EC> listeEC) {
		this.listeEC = listeEC;
	}

	public int getNumUE() {
		return numUE;
	}
	
	public void setNumUE(int numUE) {
		this.numUE = numUE;
	}
	
	public Semestre getSemestre() {
		return semestre;
	}
	
	public void setSemestre(Semestre semestre) {
		this.semestre = semestre;
	}
	
	public Formation getFormation() {
		return formation;
	}
	
	public void setFormation(Formation formation) {
		this.formation = formation;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
